package com.haohan.jingyuan.customer.helper;

import com.haohan.jingyuan.customer.dto.resp.IncomeInfoResp;
import com.haohan.jingyuan.customer.entity.CustomerIncome;

/**
 * 收入响应对象转换工具类
 * 
 * @ClassName IncomeRespHelper
 * @Description 收入响应对象转换工具
 * @Author hexijun
 * @Time 2025/01/19 16:00
 * @Version 1.0
 */
public class IncomeRespHelper {

    /**
     * 将收入实体转换为收入信息响应对象
     * 
     * @param customerIncome 收入实体
     * @return 收入信息响应对象
     */
    public static IncomeInfoResp convert2IncomeInfoResp(CustomerIncome customerIncome) {
        if (customerIncome == null) {
            return null;
        }

        IncomeInfoResp incomeInfoResp = new IncomeInfoResp();
        incomeInfoResp.setId(customerIncome.getId());
        incomeInfoResp.setCustomerId(customerIncome.getCustomerId());
        incomeInfoResp.setIncomeType(customerIncome.getIncomeType());
        incomeInfoResp.setTotalAmount(customerIncome.getTotalAmount());
        incomeInfoResp.setReceivedAmount(customerIncome.getReceivedAmount());
        incomeInfoResp.setPendingAmount(customerIncome.getPendingAmount());
        incomeInfoResp.setIncomeDate(customerIncome.getIncomeDate());
        incomeInfoResp.setRemarks(customerIncome.getRemarks());
        incomeInfoResp.setCreator(customerIncome.getCreator());
        incomeInfoResp.setGmtCreated(customerIncome.getGmtCreated());
        incomeInfoResp.setModifier(customerIncome.getModifier());
        incomeInfoResp.setGmtModified(customerIncome.getGmtModified());

        return incomeInfoResp;
    }
}
